From: Eli Zaretskii Date: Thu, 9 Jul 2009 18:44:14 +0000 (+0000) Subject: (stat): Treat UNC file names as residing on remote drives. (Bug#3542) X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~11566 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=d11ec2e127234d1c289624f8ad4ae9d7f82f6942;p=emacs.git (stat): Treat UNC file names as residing on remote drives. (Bug#3542) --- diff --git a/src/w32.c b/src/w32.c index ef0272259c4..2a7be366aec 100644 --- a/src/w32.c +++ b/src/w32.c @@ -3347,11 +3347,13 @@ stat (const char * path, struct stat * buf) } } - /* GetDriveType needs the root directory of NAME's drive. */ - if (!(strlen (name) >= 2 && IS_DEVICE_SEP (name[1]))) - devtype = GetDriveType (NULL); /* use root of current diectory */ + if (IS_DIRECTORY_SEP (name[0]) && IS_DIRECTORY_SEP (name[1])) + devtype = DRIVE_REMOTE; /* assume UNC name is remote */ + else if (!(strlen (name) >= 2 && IS_DEVICE_SEP (name[1]))) + devtype = GetDriveType (NULL); /* use root of current drive */ else { + /* GetDriveType needs the root directory of NAME's drive. */ strncpy (drive_root, name, 3); drive_root[3] = '\0'; devtype = GetDriveType (drive_root);